package org.longxin.domains;

// Generated 2015-1-5 21:21:32 by Hibernate Tools 3.4.0.CR1

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;

import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;


/**
 * Department generated by hbm2java
 */
@Entity
@Table(name = "requirements", catalog = "longxin")
public class Requirements implements java.io.Serializable, Cloneable
{
    /**
     * 
     */
    private static final long serialVersionUID = 7270009249226591404L;

    private Integer id;
    
    private Product product;
    
    private String sequence;
    
    private String name;
    
    private String createDate;

    private String originNo;
    
    private String gRequirement;
    
    private String valueScope;
    
    private String customerA;
    
    private String customerB;
    
    private String customerC;
    
    private String customerD;
    
    private String brandA;
    
    private String brandB;
    
    private String brandC;
    
    private String brandD;
    
    private String aaComponent;
    
    private String aaResult;
    
    private String aaRequirement;
    
    private String aaScope;
    
    private String trackDocument;
    
    private String confirmedResult;
    
    private String responsible;
    
    private String originPlan;
    
    private String updateDate;
    
    private String closeDate;
    
    private String finalResult;
    
    public static final String DATEFORMAT = "yyyy-MM-dd";
    
    //private Boolean isDraft;

    public Requirements()
    {
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    public Integer getId()
    {
        return id;
    }

    public void setId(Integer id)
    {
        this.id = id;
    }
    
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "PRODUCT", nullable = false)
    public Product getProduct()
    {
        return this.product;
    }

    public void setProduct(Product product)
    {
        this.product = product;
    }

    @Column(name = "SEQUENCE")
    public String getSequence()
    {
        return sequence;
    }

    public void setSequence(String sequence)
    {
        this.sequence = sequence;
    }

    @Column(name = "NAME")
    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }
    
    //@Temporal(TemporalType.TIMESTAMP)
    @Column(name = "CREATE_DATE", nullable = false, length = 19)
    public String getCreateDate()
    {
        return createDate;
    }
    
    @Transient
    public String getDisplayCreateDate()
    {
//        if(this.getCreateDate()!=null)
//        {
//            SimpleDateFormat sdf = new SimpleDateFormat(DATEFORMAT);
//            return sdf.format(this.getCreateDate());
//        }
//        return "";
        return this.getCreateDate();
    }

    public void setCreateDate(String createDate)
    {
        this.createDate = createDate;
    }
    

    @Column(name = "ORIGIN_NO")
    public String getOriginNo()
    {
        return originNo;
    }

    public void setOriginNo(String originNo)
    {
        this.originNo = originNo;
    }

    @Column(name = "G_REQUIREMENT")
    public String getgRequirement()
    {
        return gRequirement;
    }

    public void setgRequirement(String gRequirement)
    {
        this.gRequirement = gRequirement;
    }

    @Column(name = "VALUE_SCOPE")
    public String getValueScope()
    {
        return valueScope;
    }

    public void setValueScope(String valueScope)
    {
        this.valueScope = valueScope;
    }

    @Column(name = "CUSTOMERA")
    public String getCustomerA()
    {
        return customerA;
    }

    public void setCustomerA(String customerA)
    {
        this.customerA = customerA;
    }

    @Column(name = "CUSTOMERB")
    public String getCustomerB()
    {
        return customerB;
    }

    public void setCustomerB(String customerB)
    {
        this.customerB = customerB;
    }

    @Column(name = "CUSTOMERC")
    public String getCustomerC()
    {
        return customerC;
    }

    public void setCustomerC(String customerC)
    {
        this.customerC = customerC;
    }

    @Column(name = "CUSTOMERD")
    public String getCustomerD()
    {
        return customerD;
    }

    public void setCustomerD(String customerD)
    {
        this.customerD = customerD;
    }

    @Column(name = "BRANDA")
    public String getBrandA()
    {
        return brandA;
    }

    public void setBrandA(String brandA)
    {
        this.brandA = brandA;
    }

    @Column(name = "BRANDB")
    public String getBrandB()
    {
        return brandB;
    }

    public void setBrandB(String brandB)
    {
        this.brandB = brandB;
    }

    @Column(name = "BRANDC")
    public String getBrandC()
    {
        return brandC;
    }

    public void setBrandC(String brandC)
    {
        this.brandC = brandC;
    }

    @Column(name = "BRANDD")
    public String getBrandD()
    {
        return brandD;
    }

    public void setBrandD(String brandD)
    {
        this.brandD = brandD;
    }

    @Column(name = "AA_COMPONENT")
    public String getAaComponent()
    {
        return aaComponent;
    }

    public void setAaComponent(String aaComponent)
    {
        this.aaComponent = aaComponent;
    }

    @Column(name = "AA_RESULT")
    public String getAaResult()
    {
        return aaResult;
    }

    public void setAaResult(String aaResult)
    {
        this.aaResult = aaResult;
    }

    @Column(name = "AA_REQUIREMENT")
    public String getAaRequirement()
    {
        return aaRequirement;
    }

    public void setAaRequirement(String aaRequirement)
    {
        this.aaRequirement = aaRequirement;
    }

    @Column(name = "AA_SCOPE")
    public String getAaScope()
    {
        return aaScope;
    }

    public void setAaScope(String aaScope)
    {
        this.aaScope = aaScope;
    }

    @Column(name = "TRACK_DOCUMENT")
    public String getTrackDocument()
    {
        return trackDocument;
    }

    public void setTrackDocument(String trackDocument)
    {
        this.trackDocument = trackDocument;
    }

    @Column(name = "CONFIRMED_RESULT")
    public String getConfirmedResult()
    {
        return confirmedResult;
    }

    public void setConfirmedResult(String confirmedResult)
    {
        this.confirmedResult = confirmedResult;
    }
    
    @Column(name = "RESPONSIBLE")
    public String getResponsible()
    {
        return responsible;
    }

    public void setResponsible(String responsible)
    {
        this.responsible = responsible;
    }

    @Column(name = "ORIGIN_PLAN")
    public String getOriginPlan()
    {
        return originPlan;
    }

    public void setOriginPlan(String originPlan)
    {
        this.originPlan = originPlan;
    }

   // @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "UPDATE_DATE", length = 19)
    public String getUpdateDate()
    {
        return updateDate;
    }

    public void setUpdateDate(String updateDate)
    {
        this.updateDate = updateDate;
    }
    
    @Transient
    public String getDisplayUpdateDate()
    {
//        if(this.getUpdateDate()!=null)
//        {
//            SimpleDateFormat sdf = new SimpleDateFormat(DATEFORMAT);
//            return sdf.format(this.getUpdateDate());
//        }
//        return "";
        return this.getUpdateDate();
    }

    //@Temporal(TemporalType.TIMESTAMP)
    @Column(name = "CLOSE_DATE", length = 19)
    public String getCloseDate()
    {
        return closeDate;
    }

    public void setCloseDate(String closeDate)
    {
        this.closeDate = closeDate;
    }
    
    @Transient
    public String getDisplayCloseDate()
    {
//        if(this.getCloseDate()!=null)
//        {
//            SimpleDateFormat sdf = new SimpleDateFormat(DATEFORMAT);
//            return sdf.format(this.getCloseDate());
//        }
//        return "";
        return this.getCloseDate();
    }
    
    @Column(name = "FINAL_RESULT")
    public String getFinalResult()
    {
        return finalResult;
    }

    public void setFinalResult(String finalResult)
    {
        this.finalResult = finalResult;
    }
    
    public Object clone() throws CloneNotSupportedException
    {
        Requirements cloned = (Requirements) super.clone();
        cloned.setId(null);

        return cloned;
    }
}
